<template>
	<view class="item-product f-a-start">
		<image :src="$imgUrl(goods.image)" mode="aspectFill" class="item-pic"></image>
		<view class="right-info">
			<view class="ellipsis2 name">{{goods.goods_name}}</view>
			<view class="spec f-c-between">
				<span>规格：{{goods.attr_name}}</span>
				<view class="status" :style="{color:statusColor}">{{orderStatusMap[goods.status]}}</view>
			</view>
			<view class="bottom f-c-between">
				<view class="price">¥{{goods.price}}</view>
				<view class="num">X {{goods.num}}</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		mapState,
		mapGetters,
	} from 'vuex'
	export default {
		name: "orderProduct",
		props: {
			statusColor: {
				type: String,
				default: '#FF5800'
			},
			goods: {
				type: Object,
				default: () => {}
			}
		},
		data() {
			return {

			};
		},
		computed: {
			...mapGetters(['orderStatusMap'])
		}
	}
</script>

<style lang="scss">
	.item-product {
		width: 100%;

		.item-pic {
			min-width: 152rpx;
			max-width: 152rpx;
			height: 152rpx;
			border-radius: 10rpx;
			display: block;
			margin-right: 24rpx;
		}

		.right-info {
			flex: 1;

			.name {
				font-weight: 400;
				// font-size: 26rpx;
				font-size: calc(26rpx * 1.4);
				color: #333333;
				// line-height: 32rpx;
				line-height: calc(32rpx * 1.4);
			}

			.spec {
				font-weight: 400;
				// font-size: 24rpx;
				font-size: calc(24rpx * 1.3);
				color: #676767;
				margin-top: 8rpx;

				.status {
					color: #FF5800;
				}
			}

			.bottom {
				margin-top: 8rpx;

				.price {
					font-weight: 500;
					// font-size: 32rpx;
					font-size: calc(32rpx * 1.2);
					color: #FF5800;
				}

				.num {
					font-weight: 500;
					// font-size: 24rpx;
					font-size: calc(24rpx * 1.3);
					color: #333333;
				}
			}
		}
	}
</style>